#ifndef SENSORMODEL_H
#define SENSORMODEL_H

#include <QAbstractListModel>
#include <QByteArray>
#include <QList>
#include <QString>


class SensorModel : public QAbstractListModel
{
    Q_OBJECT
    Q_PROPERTY(int count READ rowCount NOTIFY rowCountChanged)

public: // Data types

    enum SensorModelRoles {
        TypeRole = Qt::UserRole + 1,
    };

public:
    explicit SensorModel(QObject *parent = 0);
    virtual ~SensorModel();

public: // From QAbstractListModel
    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    int rowCount(const QModelIndex &parent = QModelIndex()) const;
    void removeRow(int row, const QModelIndex &parent);

public:
    QByteArray typeByString(const QString &typeString);

public slots:
    void setSensorTypes(QList<QByteArray> types);
    void clear();

signals:
    void rowCountChanged(int count);

private: // Data
    QList<QByteArray> m_sensorTypes;
};

#endif // SENSORMODEL_H
